%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/v4/bigint"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 8, 9, 21, 10<br />2: PgSelect[7]<br />3: PgSelectRows[12]<br />ᐳ: First[11], PgSelectSingle[13]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 13<br /><br />ROOT PgSelectSingleᐸrange_testᐳ[13]"):::bucket
    Bucket2("Bucket 2 (nullableBoundary)<br />Deps: 14<br /><br />ROOT PgClassExpression{1}ᐸ__range_test__.”int8”ᐳ[14]"):::bucket
    Bucket3("Bucket 3 (nullableBoundary)<br />Deps: 15, 17, 19<br /><br />ROOT Access{2}ᐸ14.startᐳ[15]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 16, 18, 20<br /><br />ROOT Access{2}ᐸ14.endᐳ[16]"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket2
    Bucket2 --> Bucket3 & Bucket4

    %% plan dependencies
    PgSelect7[["PgSelect[7∈0] ➊<br />ᐸrange_testᐳ<br />More deps:<br />- Constantᐸ934ᐳ[21]"]]:::plan
    Object10{{"Object[10∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Object10 --> PgSelect7
    Access8{{"Access[8∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access8 & Access9 --> Object10
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access8
    __Value2 --> Access9
    First11{{"First[11∈0] ➊"}}:::plan
    PgSelectRows12[["PgSelectRows[12∈0] ➊"]]:::plan
    PgSelectRows12 --> First11
    PgSelect7 --> PgSelectRows12
    PgSelectSingle13{{"PgSelectSingle[13∈0] ➊<br />ᐸrange_testᐳ"}}:::plan
    First11 --> PgSelectSingle13
    PgClassExpression14{{"PgClassExpression[14∈1] ➊<br />ᐸ__range_test__.”int8”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression14
    Access15{{"Access[15∈2] ➊<br />ᐸ14.startᐳ"}}:::plan
    PgClassExpression14 --> Access15
    Access16{{"Access[16∈2] ➊<br />ᐸ14.endᐳ"}}:::plan
    Access15 o--o Access16
    Access17{{"Access[17∈2] ➊<br />ᐸ14.start.valueᐳ"}}:::plan
    Access16 o--o Access17
    Access18{{"Access[18∈2] ➊<br />ᐸ14.end.valueᐳ"}}:::plan
    Access17 o--o Access18
    Access19{{"Access[19∈2] ➊<br />ᐸ14.start.inclusiveᐳ"}}:::plan
    Access18 o--o Access19
    Access20{{"Access[20∈2] ➊<br />ᐸ14.end.inclusiveᐳ"}}:::plan
    Access19 o--o Access20

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect7,Access8,Access9,Object10,First11,PgSelectRows12,PgSelectSingle13 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgClassExpression14 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,Access15,Access16,Access17,Access18,Access19,Access20 bucket2
    classDef bucket3 stroke:#ffa500
    class Bucket3 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4 bucket4

